package com.hyper_yang.javase.learnException.mayOccur;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

public class ErrorTest {

    @DisplayName("内存不足(堆) Error:")
    @Test
    public void test01() {
        // java.lang.OutOfMemoryError: Requested array size exceeds VM limit
        long[] longs = new long[Integer.MAX_VALUE];
    }

    @DisplayName("内存不足(栈) Error:")
    @Test
    public void test02() {
        // java.lang.StackOverflowError
        a();
    }
    void a(){
        a();
    }
}
